package com.heima.api.client;

import com.heima.api.config.DefaultFeignConfig;
import com.heima.api.fallback.CartClientFallback;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
//configuration = DefaultFeignConfig.class 配置日志生效级别 局部生效
//在微服务启动类中添加 @EnableFeignClients(defaultConfiguration = DefaultFeignConfig.class) 全局生效
@FeignClient(value = "cart-service"
        ,configuration = DefaultFeignConfig.class
        ,fallbackFactory = CartClientFallback.class)
public interface CartClient {
    @DeleteMapping("/carts")
    void deleteCartItemByIds(@RequestParam("ids") List<Long> ids);
}
